﻿using System.Reflection;
using Abp.Hangfire;
using Abp.Hangfire.Configuration;
using Abp.Modules;
using Abp.Reflection.Extensions;
using Abp.Threading.BackgroundWorkers;
using Abp.Zero;
using KelonProud.BackgroundJobs.Core;

namespace KelonProud.BackgroundJobs
{
    [DependsOn(typeof(AbpZeroCoreModule),typeof(AbpHangfireAspNetCoreModule))]
    public class KelonProudBackgroundJobModule: AbpModule
    {
        public override void PreInitialize()
        {
            Configuration.BackgroundJobs.UseHangfire();
            base.PreInitialize();
        }

        public override void Initialize()
        {
            var thisAssembly = typeof(KelonProudBackgroundJobModule).GetAssembly();

            IocManager.RegisterAssemblyByConvention(thisAssembly);
        }

        public override void PostInitialize()
        {
          //  IocManager.Resolve<JobInitialize>().Init();
        }
    }
}
